require("./base.css");

console.log('欢迎使用webpack...');
console.log('测试');

const http = new XMLHttpRequest();

http.onreadystatechange = function(){
    if(http.readyState ==4 && http.status==200){
        console.log(http.responseText);
        var res = http.responseText;
        document.body.innerHTML+=eval(res).data[0].name;
    }
}




document.getElementsByTagName("button")[0].onclick = function(){
    setTimeout(function(){
    var id =document.getElementsByTagName("input")[0].value;
    http.open('get','/getStudent?id='+id);
    http.send(null);
    }.bind(this),20)
   
}